#ifndef BYZHIHU_H
#define BYZHIHU_H

#include <QWebEngineProfile>
#include <QWebEngineScript>
#include <QWebEngineScriptCollection>
#include <QWebEngineView>

#define LINKWIKIZHIHU(a,x,y,z)   \
    LINKWIKI(a,x,y,z)\
class a##ByZhiHu : public a { \
    public: \
    WIKI_NO_CONTENT \
    void content_item(const QListWidgetItem *item, QWebEngineView *view) override \
    { \
        view->load(prefix() + item->data(990).toString()); \
         \
        QWebEngineProfile *profile = view->page()->profile(); \
        QWebEngineScriptCollection *scripts = profile->scripts(); \
        QString code; \
        code.append("document.querySelector(\"#root > div > main > div > div.ColumnPageHeader-Wrapper\").remove();"); \
        code.append("document.querySelector(\"#root > div > main > div > div.Post-Sub\").remove();"); \
        code.append("document.querySelector(\"#root > div > main > div > article  div.ContentItem-actions\").remove();"); \
        /*code.append("document.querySelector(\"#root > div > main > div > article > header  div.Post-Author\").remove();");*/ \
        code.append("document.querySelector(\"#root > div > main > div > article > header  div.css-dvccr2\").remove();"); \
        QWebEngineScript self; \
        self.setSourceCode(code); \
        scripts->insert(self); \
    } \
};

#endif // BYZHIHU_H
